package com.qf.controller;

import com.qf.pojo.resp.BaseResp;
import com.qf.service.XcJqService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 *  景区查询
 * @author WYD
 * @date 2021/10/25  16:09
 */
@Api(value = "景区查询",tags = "景区查询")
@RequestMapping("/jq")
@RestController
public class XcJqController {

    @Autowired
    XcJqService xcJqService;

    /**
     *  点击景区，根据热度显示所有景区
     * @return
     */
    @ApiOperation("点击景区，根据热度显示所有景区")
    @RequestMapping(value = "/findAreaHot",method = RequestMethod.GET)
    public BaseResp findAreaHot(){
        return xcJqService.findAreaHot();
    }

    /**
     *  选择城市，查询热门景区
     *    ++ 区景区的热度
     * @param
     * @return
     */
    @ApiOperation("用户输入城市，查询热门景区")
    @RequestMapping(value = "/findByCityId/{cityId}",method = RequestMethod.GET )
    public BaseResp findByCityId(@ApiParam(name = "cityId",value = "城市cityId",required = true)
                                     @PathVariable("cityId")Integer cityId){
        return xcJqService.findByCityId(cityId);
    }

    /**
     * 根据区查景区
     *   + + 遍历所有
     * @return
     */
    @ApiOperation("根据区查景区")
    @RequestMapping(value = "/findByCityAreaId/{areaId}", method = RequestMethod.GET)
    public BaseResp findByCityAreaId(@ApiParam(name = "areaId",value = "区areaId",required = true)
                                         @PathVariable("areaId")Integer areaId){
        return xcJqService.findByCityAreaId(areaId);
    }


    /**
     * 单个景区详情
     * @param qcId
     * @return
     */
    @ApiOperation("单个景区详情")
    @RequestMapping(value = "/findQcDetailByQcId/{qcId}",method = RequestMethod.GET)
    public BaseResp findQcDetailByQcId(@ApiParam(name = "qcId",value = "景区qcId",required = true)
                                           @PathVariable("qcId")Integer qcId){
        return xcJqService.findQcDetailByQcId(qcId);
    }


}
